package com.league.zjxn.main.mine

import androidx.core.widget.addTextChangedListener
import com.league.zjxn.R
import com.league.zjxn.jetpack.vmodel.AccessViewModel
import com.module.lemlin.owner.OwnerViewModeFragment
import kotlinx.android.synthetic.main.fragment_account_phone.*

class AccountPhoneFragment : OwnerViewModeFragment<AccessViewModel>() {

    companion object {
        fun newInstance(): AccountPhoneFragment {
            return AccountPhoneFragment()
        }
    }

    override fun viewModel(): AccessViewModel {
        return createViewModel(requireActivity())
    }

    override val layoutResId: Int
        get() = R.layout.fragment_account_phone

    override fun initView() {
        etAccountPhonePhone.addTextChangedListener { editable ->
            editable?.let { viewModel.mMapSettingPhone["mobile"] = it.toString() }
            tvAccountPhoneSubmit.isEnabled = !editable.isNullOrEmpty()
        }
    }

    override fun onDestroy() {
        super.onDestroy()

    }
}